-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Enable UAP Remote Execution for all tests #21014
Enable UAP Remote Execution for all tests #21014
Conversation
@weshaggard @ericstj could you please have a look? this is refactoring the remote execution code to be in its own library to avoid adding UAP configuration to all test projects. |
CC @stephentoub @joperezr @safern @danmosemsft |
Note that, I'll not merge the changes here till we get Helix uses RS2 OS images. so this PR is kind of blocked by that. |
@mmitche OSX legs failed because of out of disk space. I am not sure why portable Linux failed. do you know why? |
FYI @dotnet/eng-first @dotnet-bot test Innerloop OSX10.12 Debug x64 Build and Test Not sure why the portable build failed. The line at the end is "script returned -1". https://ci3.dot.net/blue/organizations/jenkins/dotnet_corefx%2Fmaster%2Fportable-linux-Config_Debug%2BOuterLoop_false_prtest/detail/portable-linux-Config_Debug%20OuterLoop_false_prtest/863/pipeline I wonder whether the build crashed. |
@dotnet-bot test Portable Linux x64 Debug Build |
src/TestHelper/dir.props
Outdated
@@ -0,0 +1,8 @@ | |||
<?xml version="1.0" encoding="utf-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a more descriptive name than TestHelper we could use? CoreFx.TestUtilities or something along those lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weshaggard @ericstj what you think of naming this library? I agree with @stephentoub to have better name as TestHelper is more generic. Having CoreFX in the name can give idea it is corefx specific library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @stephentoub as well. CoreFx.TestUtilties is fine by me. As we had discussed before you could consider using Private or Internal in the name if you wanted to discourage its use by product assemblies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we expect that we will put other test stuff in here like PlatformDetection and our custom Asserts? We should actually consider doing that now that we have a test helper library here.
As for a name I don't know if we need the name CoreFX included as I don't know that it buys us much, but I do wonder if we shouldn't have it under the Common folder so it doesn't look like a shipping library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to focus on the remote execution so I would to keep the changes in this PR to the remote execution only and we can later move more test code as PlatformDetection there.
I kept the test library folder with other libraries per @ericstj recommendation. so I am not sure if we have to move it to the common folder? please advise if I should do that.
for naming I'll go with CoreFX.Private.TestUtlities. let me know if you disagree with this name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to focus on the remote execution so I would to keep the changes in this PR to the remote execution only and we can later move more test code to PlatformDetection there.
Sounds good.
I kept the test library folder with other libraries per @ericstj recommendation. so I am not sure if we have to move it to the common folder? please advise if I should do that.
Given that it has a ref and other configurations keeping it here is probably easier, lets do that for now and see if any issues arise.
for naming I'll go with CoreFX.Private.TestUtlities. let me know if you disagree with this name.
That is fine, but I think you want CoreFx.Private.TestUtilities
namespace System.Diagnostics | ||
{ | ||
/// <summary>Base class used for all tests that need to spawn a remote process.</summary> | ||
public abstract partial class RemoteExecutorTestBase : FileCleanupTestBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume none of this code has changed, so I'm not re-reviewing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I didn't change any code logic. I had to change some internal specifiers to be public specifier instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @tarekgh
src/TestHelper/ref/TestHelper.cs
Outdated
@@ -0,0 +1,127 @@ | |||
// Licensed to the .NET Foundation under one or more agreements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look like it was generated by GenAPI. Any reason not to have it generated so we can easily regenerate in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You caught it :-) I'll regenerate using GenAPI
src/TestHelper/dir.props
Outdated
<Import Project="..\dir.props" /> | ||
<PropertyGroup> | ||
<AssemblyVersion>4.0.0.0</AssemblyVersion> | ||
<AssemblyKey>MSFT</AssemblyKey> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't use the MSFT Key. For this please use the Test key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also probably use 1.0.0.0 as the assembly version, just because it is different from our shipping libraries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix those
src/TestHelper/src/TestHelper.csproj
Outdated
|
||
<ItemGroup Condition="'$(TargetGroup)' == 'uap'"> | ||
<Reference Include="Windows" /> | ||
<Reference Include="WindowsBase" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does WindowsBase need to be referenced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove WindowsBase. will try that.
@@ -0,0 +1,66 @@ | |||
// Licensed to the .NET Foundation under one or more agreements. | |||
// The .NET Foundation licenses this file to you under the MIT license. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would name this file something like ".process" instead of "nouap", to better call out what it is doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to name the files with the targetGroup id's. but I don't have any objection to rename it as you suggested.
@@ -114,7 +114,7 @@ | |||
Condition="'$(TargetGroup)'=='uap'" > | |||
|
|||
<PropertyGroup> | |||
<UAPToolsPackageVersion>1.0.2</UAPToolsPackageVersion> | |||
<UAPToolsPackageVersion>1.0.4</UAPToolsPackageVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you will need to merge with @joperezr's changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I'll merge with @joperezr changes after his PR merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, we already talked about this, we will have to create a new version entirely for his changes to work, so we will rebase this PR once mine is merged.
src/TestHelper/dir.props
Outdated
@@ -0,0 +1,8 @@ | |||
<?xml version="1.0" encoding="utf-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to focus on the remote execution so I would to keep the changes in this PR to the remote execution only and we can later move more test code to PlatformDetection there.
Sounds good.
I kept the test library folder with other libraries per @ericstj recommendation. so I am not sure if we have to move it to the common folder? please advise if I should do that.
Given that it has a ref and other configurations keeping it here is probably easier, lets do that for now and see if any issues arise.
for naming I'll go with CoreFX.Private.TestUtlities. let me know if you disagree with this name.
That is fine, but I think you want CoreFx.Private.TestUtilities
/// <summary>Base class used for all tests that need to spawn a remote process.</summary> | ||
public abstract partial class RemoteExecutorTestBase : FileCleanupTestBase | ||
{ | ||
protected static readonly string HostRunnerExecutableName = "dotnet"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this is further clean-up of what was already there it doesn't look like HostRunnerExecutableName and HostRunnerName are even used anywhere so they can just be deleted. In which case HostRunner is all that is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HostRunnerName is used in the S.D.Process tests. but I'll look at the ones not used outside here and will remove them.
/// <summary>Base class used for all tests that need to spawn a remote process.</summary> | ||
public abstract partial class RemoteExecutorTestBase : FileCleanupTestBase | ||
{ | ||
protected static readonly string HostRunnerExecutableName = "xunit.runner.uap"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't look like any of these Host fields are used in the uap case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept it because it is used in other test code like S.D.Process tests. as I mentioned in other comment I'll try to get rid of the fields not used in the test projects
@tarekgh I've merged my PR so you should be able to rebase this and merge it in now. |
This change to enable remote execution of all corefx tests in UAP. Because the remote execution code for UAP is using WinRT APIs and to avoid forcing adding UAP configuration to all test projects, we factor the remote execution code into its own test library (called TestHelper) which is cross compiled.
4d03638
to
412bdb6
Compare
Thanks all for your review and comments. |
This change to enable remote execution of all corefx tests in UAP. Because the remote execution code for UAP is using WinRT APIs and to avoid forcing adding UAP configuration to all test projects, we factor the remote execution code into its own test library (called TestHelper) which is cross compiled. Commit migrated from dotnet/corefx@eb2f543
This change to enable remote execution of all corefx tests in UAP. Because the remote execution code for UAP is using WinRT APIs and to avoid forcing adding UAP configuration to all test projects, we factor the remote execution code into its own test library (called TestHelper) which is cross compiled.